<?php
use yii\helpers\Html;

$i=0;
foreach ($dropdowns as $item) {
    echo Html::dropDownList("GoodsForm[category][]", $item['id'], $item['list'], ['multiple' => 'multiple', 'class' => 'goods-category']);
    $i++;
}

?>

<script>
    goods_category_onselect();
    $('#goods-brand_id').empty().append('<option value="0">不选择</option>');
    <?php
    if (!empty($brands)) {
        foreach ($brands as $brand) {
            echo '$("#goods-brand_id").append(\'<option value="' . $brand->id . '">' . $brand->name . '</option>\');';
        }
    }
    ?>
</script>